-
Notifications
You must be signed in to change notification settings - Fork 324
feat(genai): add logprobs support #1266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
hossam1522
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| """Stop sequences for the model.""" | ||
|
|
||
| logprobs: int | None = None | ||
| """The number of logprobs to return.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this correct? It doesn't appear to affect output for me. Setting to 0 (or False) also appears to still keep chosen_candidates
|
I also think we ought to mention the instability of the param https://discuss.ai.google.dev/t/logprobs-is-not-enabled-for-gemini-models/107989/15 I can't get newer Gemini models (2.5) to return logprobs via the genai API either |
Description
Implement logprobs support in chat_models.py to
ChatGoogleGenerativeAIRelevant issues
Fixes #718
Type
π New Feature
β Test
Changes(optional)
Files changed
chat_models.pyandtest_chat_models.pyTesting(optional)
Added
test_logprobsfunction intest_chat_models.pyNote(optional)